import request from '@/utils/request'

export async function login(data) {
  return request({
    url: '/comdesk_auth/login',
    method: 'post',
    data,
  })
}

export async function gh_login(data) {
  return request({
    url: '/comdesk_auth/gh_login',
    method: 'post',
    data,
  })
}

export async function userLoginApi(data) {
  const res = await request({
    url: '/auth/user_login',
    method: 'post',
    data: data,
  })
  return res
}

export async function socialLogin(data) {
  return request({
    url: '/socialLogin',
    method: 'post',
    data,
  })
}

export function getUserInfo() {
  return request({
    url: '/userInfo',
    method: 'get',
  })
}

export function logout() {
  // 退出登录调用接口
  // return request({
  //   url: '/logout',
  //   method: 'get',
  // })
}

export function register(data) {
  return request({
    url: '/register',
    method: 'post',
    data,
  })
}
